const express = require('express');
const router = express.Router();
const authController = require('../controllers/authController');
const { authenticateToken } = require('../middleware/auth');
const { validateRegister, validateLogin } = require('../middleware/validation');

// 用户注册
router.post('/register', validateRegister, authController.register);

// 用户登录
router.post('/login', validateLogin, authController.login);

// 获取当前用户信息
router.get('/me', authenticateToken, authController.getMe);

// 更新用户信息
router.put('/profile', authenticateToken, authController.updateProfile);

module.exports = router;
